export const state = () => ({
  counter: 1,
  list: []
});

export const mutations = {
  ADD_COUNTER(state, payload) {
    state.counter += 1;
  },
  ADD_LIST(state, payload) {
    state.list = payload;
  }
};

export const actions = {
  add_counter({ commit }) {
    commit('ADD_COUNTER');
  },
  add_list({ commit }, payload) {
    console.log(payload);
    commit('ADD_LIST', payload);
  }
};

export const getters = {
  counter: (state) => state.counter
};
